Exploring Biome: A Guide to Installing and Using it in Visual Studio Code
2024.05.08
Hi, this is Charu from Classmethod. In this blog, we will be learning about Biome.
Biome Formatter is a powerful tool designed to beautify and standardize your code within Visual Studio Code. When compared with prettier, it is stricter than Prettier parser.
Step 1: Installing Biome Formatter
biome --help
Step 2: Configuration
pnpm biome init
{ "$schema": "https://biomejs.dev/schemas/1.7.3/schema.json", "organizeImports": { "enabled": true }, "linter": { "enabled": true, "rules": { "recommended": true } } }
"files":{ "ignore": ["cdk.out"] },
Step 3: Automate
.vscode>settings.json
file{ "editor.formatOnSave": true, "editor.defaultFormatter": "biomejs.biome", "editor.codeActionsOnSave": { "quickfix.biome": "explicit", "source.organizeImports.biome": "explicit" } }
"scripts": { "lint": "pnpm biome check ." }
{ "name": "your_app", "version": "0.1.0", "scripts": { "lint": "pnpm biome check ." }, "devDependencies": { "@biomejs/biome": "1.7.3" }, "dependencies": {} }
Step 4: Run
pn lint
Conclusion:
By following this guide, you've learned how to install and configure Biome Formatter, format your code effectively, explore advanced features, and integrate the extension seamlessly into your coding workflow.
Thank you for reading!
Happy Learning:)